package Integrity;


public class CreditStatement extends Statement
{

	CreditStatement(String UserID, String ResultID,String BillingSiteID, StatementData extract) {
		super(UserID, ResultID, BillingSiteID, extract);
		card_type= extract.get_scraped_card_type();
		int_rate= extract.get_scraped_int_rate();
		credit_lim = extract.get_scraped_credit_lim();
		credit_avl = extract.get_scraped_credit_avl();
		min_amount_due = extract.get_scraped_min_amount_due();
	}
        
    /**
    * Public constructor for CreditStatement. Used for creating statements 
    * to go to the user interface, by the database manager.
    * @author Johann Jungbauer
    * @param UserID
     * @param BillingSiteID
     * @param strings
     * @param doubles
     * @param type
     * @param intRate
     * @param limit
     * @param credAvailable
     * @param minDue)
    * @return A CreditStatement object.
    */
    public CreditStatement(String UserID,String BillingSiteID,java.util.Date date,String[] strings
                , double[] doubles, String type,double intRate,double limit
                ,double credAvailable,double minDue) {
		super(UserID, BillingSiteID, date, strings,doubles);
		card_type= type;
		int_rate= intRate;
		credit_lim = limit;
		credit_avl = credAvailable;
		min_amount_due = minDue;
	}
        
	public String get_card_type() {
		return card_type;
	}
	public double get_int_rate() {
		return int_rate;
	}
	public double get_credit_lim() {
		return credit_lim;
	}
	public double get_credit_avl() {
		return credit_avl;
	}
	public double get_min_amount_due() {
		return min_amount_due;
	}
	@Override public String toString() {
		StringBuilder resultToString = new StringBuilder();
		String NEW_LINE = System.getProperty("line.separator");
		resultToString.append(super.toString());
		resultToString.append(""+ NEW_LINE);
		resultToString.append("CREDIT STATEMENT SPECIFIC DATA "+ NEW_LINE);
		resultToString.append("card_type: " + card_type + NEW_LINE);
		resultToString.append("int_rate: " + Double.toString(int_rate) + NEW_LINE);
		resultToString.append("credit_lim: " + Double.toString(credit_lim) + NEW_LINE);
		resultToString.append("credit_avl: " + Double.toString(credit_avl) + NEW_LINE);
		resultToString.append("min_amount_due: " + Double.toString(min_amount_due) + NEW_LINE);
		return resultToString.toString();
	}
	
	private String card_type="";
	private double int_rate;
	private double credit_lim;
	private double credit_avl;
	private double min_amount_due;
}
